Optimal. Leaf size=120 \[ \frac {g^2 (a+b x)^3 \left (B \log \left (\frac {e (c+d x)^2}{(a+b x)^2}\right )+A\right )}{3 b}+\frac {2 B g^2 (b c-a d)^3 \log (c+d x)}{3 b d^3}-\frac {2 B g^2 x (b c-a d)^2}{3 d^2}+\frac {B g^2 (a+b x)^2 (b c-a d)}{3 b d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.08, antiderivative size = 120, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 32, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.094, Rules used = {2525, 12, 43} \[ \frac {g^2 (a+b x)^3 \left (B \log \left (\frac {e (c+d x)^2}{(a+b x)^2}\right )+A\right )}{3 b}-\frac {2 B g^2 x (b c-a d)^2}{3 d^2}+\frac {2 B g^2 (b c-a d)^3 \log (c+d x)}{3 b d^3}+\frac {B g^2 (a+b x)^2 (b c-a d)}{3 b d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 43
Rule 2525
Rubi steps
\begin {align*} \int (a g+b g x)^2 \left (A+B \log \left (\frac {e (c+d x)^2}{(a+b x)^2}\right )\right ) \, dx &=\frac {g^2 (a+b x)^3 \left (A+B \log \left (\frac {e (c+d x)^2}{(a+b x)^2}\right )\right )}{3 b}-\frac {B \int \frac {2 (-b c+a d) g^3 (a+b x)^2}{c+d x} \, dx}{3 b g}\\ &=\frac {g^2 (a+b x)^3 \left (A+B \log \left (\frac {e (c+d x)^2}{(a+b x)^2}\right )\right )}{3 b}+\frac {\left (2 B (b c-a d) g^2\right ) \int \frac {(a+b x)^2}{c+d x} \, dx}{3 b}\\ &=\frac {g^2 (a+b x)^3 \left (A+B \log \left (\frac {e (c+d x)^2}{(a+b x)^2}\right )\right )}{3 b}+\frac {\left (2 B (b c-a d) g^2\right ) \int \left (-\frac {b (b c-a d)}{d^2}+\frac {b (a+b x)}{d}+\frac {(-b c+a d)^2}{d^2 (c+d x)}\right ) \, dx}{3 b}\\ &=-\frac {2 B (b c-a d)^2 g^2 x}{3 d^2}+\frac {B (b c-a d) g^2 (a+b x)^2}{3 b d}+\frac {2 B (b c-a d)^3 g^2 \log (c+d x)}{3 b d^3}+\frac {g^2 (a+b x)^3 \left (A+B \log \left (\frac {e (c+d x)^2}{(a+b x)^2}\right )\right )}{3 b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.05, size = 98, normalized size = 0.82 \[ \frac {g^2 \left (\frac {B (b c-a d) \left (d \left (a^2 d+4 a b d x+b^2 x (d x-2 c)\right )+2 (b c-a d)^2 \log (c+d x)\right )}{d^3}+(a+b x)^3 \left (B \log \left (\frac {e (c+d x)^2}{(a+b x)^2}\right )+A\right )\right )}{3 b} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.60, size = 245, normalized size = 2.04 \[ \frac {A b^{3} d^{3} g^{2} x^{3} - 2 \, B a^{3} d^{3} g^{2} \log \left (b x + a\right ) + {\left (B b^{3} c d^{2} + {\left (3 \, A - B\right )} a b^{2} d^{3}\right )} g^{2} x^{2} - {\left (2 \, B b^{3} c^{2} d - 6 \, B a b^{2} c d^{2} - {\left (3 \, A - 4 \, B\right )} a^{2} b d^{3}\right )} g^{2} x + 2 \, {\left (B b^{3} c^{3} - 3 \, B a b^{2} c^{2} d + 3 \, B a^{2} b c d^{2}\right )} g^{2} \log \left (d x + c\right ) + {\left (B b^{3} d^{3} g^{2} x^{3} + 3 \, B a b^{2} d^{3} g^{2} x^{2} + 3 \, B a^{2} b d^{3} g^{2} x\right )} \log \left (\frac {d^{2} e x^{2} + 2 \, c d e x + c^{2} e}{b^{2} x^{2} + 2 \, a b x + a^{2}}\right )}{3 \, b d^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 3.51, size = 248, normalized size = 2.07 \[ -\frac {2 \, B a^{3} g^{2} \log \left (b x + a\right )}{3 \, b} + \frac {1}{3} \, {\left (A b^{2} g^{2} + B b^{2} g^{2}\right )} x^{3} + \frac {{\left (B b^{2} c g^{2} + 3 \, A a b d g^{2} + 2 \, B a b d g^{2}\right )} x^{2}}{3 \, d} + \frac {1}{3} \, {\left (B b^{2} g^{2} x^{3} + 3 \, B a b g^{2} x^{2} + 3 \, B a^{2} g^{2} x\right )} \log \left (\frac {d^{2} x^{2} + 2 \, c d x + c^{2}}{b^{2} x^{2} + 2 \, a b x + a^{2}}\right ) - \frac {{\left (2 \, B b^{2} c^{2} g^{2} - 6 \, B a b c d g^{2} - 3 \, A a^{2} d^{2} g^{2} + B a^{2} d^{2} g^{2}\right )} x}{3 \, d^{2}} + \frac {2 \, {\left (B b^{2} c^{3} g^{2} - 3 \, B a b c^{2} d g^{2} + 3 \, B a^{2} c d^{2} g^{2}\right )} \log \left (d x + c\right )}{3 \, d^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.07, size = 569, normalized size = 4.74 \[ \frac {B \,b^{2} g^{2} x^{3} \ln \left (\frac {\left (\frac {a d}{b x +a}-\frac {b c}{b x +a}-d \right )^{2} e}{b^{2}}\right )}{3}+\frac {A \,b^{2} g^{2} x^{3}}{3}+B a b \,g^{2} x^{2} \ln \left (\frac {\left (\frac {a d}{b x +a}-\frac {b c}{b x +a}-d \right )^{2} e}{b^{2}}\right )+A a b \,g^{2} x^{2}+B \,a^{2} g^{2} x \ln \left (\frac {\left (\frac {a d}{b x +a}-\frac {b c}{b x +a}-d \right )^{2} e}{b^{2}}\right )-\frac {B a b \,g^{2} x^{2}}{3}+\frac {B \,b^{2} c \,g^{2} x^{2}}{3 d}+A \,a^{2} g^{2} x +\frac {2 B \,a^{3} g^{2} \ln \left (\frac {1}{b x +a}\right )}{3 b}+\frac {B \,a^{3} g^{2} \ln \left (\frac {\left (\frac {a d}{b x +a}-\frac {b c}{b x +a}-d \right )^{2} e}{b^{2}}\right )}{3 b}-\frac {2 B \,a^{3} g^{2} \ln \left (\frac {a d}{b x +a}-\frac {b c}{b x +a}-d \right )}{3 b}-\frac {2 B \,a^{2} c \,g^{2} \ln \left (\frac {1}{b x +a}\right )}{d}+\frac {2 B \,a^{2} c \,g^{2} \ln \left (\frac {a d}{b x +a}-\frac {b c}{b x +a}-d \right )}{d}-\frac {4 B \,a^{2} g^{2} x}{3}+\frac {2 B a b \,c^{2} g^{2} \ln \left (\frac {1}{b x +a}\right )}{d^{2}}-\frac {2 B a b \,c^{2} g^{2} \ln \left (\frac {a d}{b x +a}-\frac {b c}{b x +a}-d \right )}{d^{2}}+\frac {2 B a b c \,g^{2} x}{d}-\frac {2 B \,b^{2} c^{3} g^{2} \ln \left (\frac {1}{b x +a}\right )}{3 d^{3}}+\frac {2 B \,b^{2} c^{3} g^{2} \ln \left (\frac {a d}{b x +a}-\frac {b c}{b x +a}-d \right )}{3 d^{3}}-\frac {2 B \,b^{2} c^{2} g^{2} x}{3 d^{2}}+\frac {A \,a^{3} g^{2}}{3 b}-\frac {B \,a^{3} g^{2}}{b}+\frac {5 B \,a^{2} c \,g^{2}}{3 d}-\frac {2 B a b \,c^{2} g^{2}}{3 d^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 1.51, size = 436, normalized size = 3.63 \[ \frac {1}{3} \, A b^{2} g^{2} x^{3} + A a b g^{2} x^{2} + {\left (x \log \left (\frac {d^{2} e x^{2}}{b^{2} x^{2} + 2 \, a b x + a^{2}} + \frac {2 \, c d e x}{b^{2} x^{2} + 2 \, a b x + a^{2}} + \frac {c^{2} e}{b^{2} x^{2} + 2 \, a b x + a^{2}}\right ) - \frac {2 \, a \log \left (b x + a\right )}{b} + \frac {2 \, c \log \left (d x + c\right )}{d}\right )} B a^{2} g^{2} + {\left (x^{2} \log \left (\frac {d^{2} e x^{2}}{b^{2} x^{2} + 2 \, a b x + a^{2}} + \frac {2 \, c d e x}{b^{2} x^{2} + 2 \, a b x + a^{2}} + \frac {c^{2} e}{b^{2} x^{2} + 2 \, a b x + a^{2}}\right ) + \frac {2 \, a^{2} \log \left (b x + a\right )}{b^{2}} - \frac {2 \, c^{2} \log \left (d x + c\right )}{d^{2}} + \frac {2 \, {\left (b c - a d\right )} x}{b d}\right )} B a b g^{2} + \frac {1}{3} \, {\left (x^{3} \log \left (\frac {d^{2} e x^{2}}{b^{2} x^{2} + 2 \, a b x + a^{2}} + \frac {2 \, c d e x}{b^{2} x^{2} + 2 \, a b x + a^{2}} + \frac {c^{2} e}{b^{2} x^{2} + 2 \, a b x + a^{2}}\right ) - \frac {2 \, a^{3} \log \left (b x + a\right )}{b^{3}} + \frac {2 \, c^{3} \log \left (d x + c\right )}{d^{3}} + \frac {{\left (b^{2} c d - a b d^{2}\right )} x^{2} - 2 \, {\left (b^{2} c^{2} - a^{2} d^{2}\right )} x}{b^{2} d^{2}}\right )} B b^{2} g^{2} + A a^{2} g^{2} x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 4.65, size = 296, normalized size = 2.47 \[ x^2\,\left (\frac {b\,g^2\,\left (9\,A\,a\,d+3\,A\,b\,c-2\,B\,a\,d+2\,B\,b\,c\right )}{6\,d}-\frac {A\,b\,g^2\,\left (3\,a\,d+3\,b\,c\right )}{6\,d}\right )-x\,\left (\frac {\left (3\,a\,d+3\,b\,c\right )\,\left (\frac {b\,g^2\,\left (9\,A\,a\,d+3\,A\,b\,c-2\,B\,a\,d+2\,B\,b\,c\right )}{3\,d}-\frac {A\,b\,g^2\,\left (3\,a\,d+3\,b\,c\right )}{3\,d}\right )}{3\,b\,d}-\frac {a\,g^2\,\left (3\,A\,a\,d+3\,A\,b\,c-2\,B\,a\,d+2\,B\,b\,c\right )}{d}+\frac {A\,a\,b\,c\,g^2}{d}\right )+\ln \left (\frac {e\,{\left (c+d\,x\right )}^2}{{\left (a+b\,x\right )}^2}\right )\,\left (B\,a^2\,g^2\,x+B\,a\,b\,g^2\,x^2+\frac {B\,b^2\,g^2\,x^3}{3}\right )+\frac {\ln \left (c+d\,x\right )\,\left (6\,B\,a^2\,c\,d^2\,g^2-6\,B\,a\,b\,c^2\,d\,g^2+2\,B\,b^2\,c^3\,g^2\right )}{3\,d^3}+\frac {A\,b^2\,g^2\,x^3}{3}-\frac {2\,B\,a^3\,g^2\,\ln \left (a+b\,x\right )}{3\,b} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [B] time = 3.13, size = 517, normalized size = 4.31 \[ \frac {A b^{2} g^{2} x^{3}}{3} - \frac {2 B a^{3} g^{2} \log {\left (x + \frac {\frac {2 B a^{4} d^{3} g^{2}}{b} + 6 B a^{3} c d^{2} g^{2} - 6 B a^{2} b c^{2} d g^{2} + 2 B a b^{2} c^{3} g^{2}}{2 B a^{3} d^{3} g^{2} + 6 B a^{2} b c d^{2} g^{2} - 6 B a b^{2} c^{2} d g^{2} + 2 B b^{3} c^{3} g^{2}} \right )}}{3 b} + \frac {2 B c g^{2} \left (3 a^{2} d^{2} - 3 a b c d + b^{2} c^{2}\right ) \log {\left (x + \frac {8 B a^{3} c d^{2} g^{2} - 6 B a^{2} b c^{2} d g^{2} + 2 B a b^{2} c^{3} g^{2} - 2 B a c g^{2} \left (3 a^{2} d^{2} - 3 a b c d + b^{2} c^{2}\right ) + \frac {2 B b c^{2} g^{2} \left (3 a^{2} d^{2} - 3 a b c d + b^{2} c^{2}\right )}{d}}{2 B a^{3} d^{3} g^{2} + 6 B a^{2} b c d^{2} g^{2} - 6 B a b^{2} c^{2} d g^{2} + 2 B b^{3} c^{3} g^{2}} \right )}}{3 d^{3}} + x^{2} \left (A a b g^{2} - \frac {B a b g^{2}}{3} + \frac {B b^{2} c g^{2}}{3 d}\right ) + x \left (A a^{2} g^{2} - \frac {4 B a^{2} g^{2}}{3} + \frac {2 B a b c g^{2}}{d} - \frac {2 B b^{2} c^{2} g^{2}}{3 d^{2}}\right ) + \left (B a^{2} g^{2} x + B a b g^{2} x^{2} + \frac {B b^{2} g^{2} x^{3}}{3}\right ) \log {\left (\frac {e \left (c + d x\right )^{2}}{\left (a + b x\right )^{2}} \right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________